//part1:C01:ep1.4.4:ep1.4.4.cpp
// total of times of a valule.
#include <iostream>
int main(void)
{
    int cur = 0, val = 0;
    if(std::cin >> cur)
    {
        int cnt = 1;
        while(std::cin >> val)
        {
            if(val == cur)
            {
                ++cnt;
            }
            else
            {
                std::cout << cur << " occurs "
                    << cnt << " times " << std::endl;
                cur = val;
                cnt = 1;    
            }
        }
        std::cout << cur << " occurs "
            << cnt << " times " << std::endl;
    }
    
    return 0;
}